class Main extends egret.DisplayObjectContainer {
    public constructor() {
        super();
        Game.initGameSettings();
        this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this);
    }

    private onAddToStage(event: egret.Event) {
        this.removeEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this);
        egret.lifecycle.onPause = () => {
            egret.ticker.pause();
        }
        egret.lifecycle.onResume = () => {

            egret.ticker.resume();
        }
        this.runGame().catch(e => {

        })
    }
    private async runGame() {
        Game.fullScreen();
        await Game.ResMgr.initAsync();
        await Game.ResMgr.loadGroup("preload");
        Game.SceneMgr.changeScene(LoginScene);
    }
}